<?php
/**
 * Created by PhpStorm.
 * User: Huyang
 * Date: 2016/9/5
 * Time: 15:17
 */

namespace App\Exceptions;

use RuntimeException;

class ServiceException extends RuntimeException
{

    protected $code;

    protected $jump;

    protected $time;

    protected $data;

    protected $message;

    public function __construct($data) {

        $this->setCode($data['code']);
        $this->setMessage($data['message']);
        $this->setTime(isset($data['time']) ? $data['time'] : '3');
        $this->setJump(isset($data['jump']) ? $data['jump'] : '');
        $this->setData(isset($data['data']) ? $data['data'] : []);

    }

    /**
     * @param mixed $code
     */
    public function setCode($code)
    {
        $this->code = $code;
    }

    /**
     * @param mixed $message
     */
    public function setMessage($message)
    {
        $this->message = $message;
    }

    /**
     * @param mixed $jump
     */
    public function setJump($jump)
    {
        $this->jump = $jump;
    }

    /**
     * @param mixed $time
     */
    public function setTime($time)
    {
        $this->time = $time;
    }

    /**
     * @param mixed $data
     */
    public function setData($data)
    {
        $this->data = $data;
    }


}